home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / csim / source.lha / source / C++SIM / Examples / Arrivals.cc next >
C/C++ Source or Header  |  1993-06-14  |  476b  |  32 lines

  1. /*
  2.  * Copyright (C) 1993
  3.  *
  4.  * Department of Computing Science,
  5.  * The University,
  6.  * Newcastle upon Tyne,
  7.  * UK.
  8.  */
  9.  
  10. #include <iostream.h>
  11.  
  12. #ifndef ARRIVALS_H_
  13. #include "Arrivals.h"
  14. #endif
  15.  
  16. #ifndef JOB_H_
  17. #include "Job.h"
  18. #endif
  19.  
  20. Arrivals::Arrivals (double mean) { InterArrivalTime = new ExponentialStream(mean); }
  21.  
  22. Arrivals::~Arrivals () { delete InterArrivalTime; }
  23.  
  24. void Arrivals::Body ()
  25. {
  26.     for(;;)
  27.     {
  28.     Hold((*InterArrivalTime)());
  29.     Job* work = new Job();
  30.     }
  31. }
  32.